/**
 * This class provide field to be filled while creating data message 
 * which can be used through getter and setter methods.
 * 
 * @author pkulkar@ncsu.edu
 */

package com.android.networking.message;

import java.util.ArrayList;

public class DataPacket {
	private static final char preamble='C';
	private int checksum; // length of data + 1 for simplicity
	private int requestType;
	private int sourceSeqNumber;
	private int pointsPathLen;
	private ArrayList pointPath;
	private String playerMode; // Drawer = D and Guesser = G
	private String answer;
	private ArrayList hint;
	private String extraData;
	private static final char postamble='C';
	
	public void computeChecksum(){
		this.setChecksum(100);
	}

	public void setChecksum(int checksum) {
		this.checksum = checksum;
	}

	public int getRequestType() {
		return requestType;
	}

	public void setRequestType(int requestType) {
		this.requestType = requestType;
	}

	public int getSourceSeqNumber() {
		return sourceSeqNumber;
	}

	public void setSourceSeqNumber(int sourceSeqNumber) {
		this.sourceSeqNumber = sourceSeqNumber;
	}

	public int getPointsPathLen() {
		return pointsPathLen;
	}

	public void setPointsPathLen(int pointsPathLen) {
		this.pointsPathLen = pointsPathLen;
	}

	public ArrayList getPointPath() {
		return pointPath;
	}

	public void setPointPath(ArrayList pointPath) {
		this.pointPath = pointPath;
	}

	public String getPlayerMode() {
		return playerMode;
	}

	public void setPlayerMode(String playerMode) {
		this.playerMode = playerMode;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public ArrayList getHint() {
		return hint;
	}

	public void setHint(ArrayList hint) {
		this.hint = hint;
	}

	public String getExtraData() {
		return extraData;
	}

	public void setExtraData(String extraData) {
		this.extraData = extraData;
	}

	public static char getPreamble() {
		return preamble;
	}

	public static char getPostamble() {
		return postamble;
	}

	public void displayControlPacket(){
		System.out.println("preamble          ==>"+preamble);
		System.out.println("checksum          ==>"+checksum); // length of data + 1 for simplicity
		System.out.println("requestType       ==>"+requestType);
		System.out.println("sourceSeqNumber   ==>"+sourceSeqNumber);
		System.out.println("pointsPathLen     ==>"+pointsPathLen);
		System.out.println("pointPath         ==>"+pointPath);
		System.out.println("playerMode        ==>"+playerMode);
		System.out.println("answer            ==>"+answer);
		System.out.println("hint              ==>"+hint);
		System.out.println("extraData         ==>"+extraData);
		System.out.println("postamble         ==>"+postamble);
	}
}
